#include "hashf.h"

hash_t
simple_hash(void *d, size_t dl)
{
    hash_t h = 0;
    hash_t * p = d;

    int i = 0;
    int mi = dl / sizeof(hash_t);
    int mode = dl % sizeof(hash_t);
    for (; i < mi; ++i) {
        h += p[i];
    }
    for (i = 1; i <= mode; ++i) {
        h += ((char*)d)[dl - i];
    }

	return h;
}
